Go 9x9
------

Have a 128K, +2 or +3? Try Go 9x9 128K (https://lawlord.itch.io/go-9x9-128k), the much stronger 128K edition.


Ten years after AlphaGo

In March 2016 a program called AlphaGo beat Lee Sedol, one of the strongest Go players in the world,
by combining Monte Carlo tree search with neural networks.
Go 9x9 brings the same family of ideas to a home computer from 1982: a 3.5 MHz Z80 and 48 kilobytes of memory. It plays 9x9 Go at about 8 kyu.


How it thinks

The computer thinks the Monte Carlo way.
Before each move it plays about 150 quick imaginary games from the current position to the end, and then plays the move that did best.
Behind this simple idea there are a few tricks:

- A search tree. The imaginary games are not independent: the computer grows a tree of the most promising lines
  and spends more games on them (Monte Carlo tree search). Every imaginary game also teaches it something about every move played in it (RAVE).
- Smart imaginary games. They are not random flailing: they capture and escape ataris, follow good local shapes and avoid self-atari.
- A sense of shape. Its first guesses come from 1,028 shape patterns and 45 tactical features packed into 4.4 KB.
  We trained them on 233,000 positions evaluated by KataGo, one of the strongest Go programs in the world.
- Ladders. Before it runs away with a string in atari, it reads the ladder to the end, and if the ladder still catches the string, it lets it go.
- An opening library of 300 positions, gathered from 600 training games.
- Thinking on your time. While you think, it thinks too, and what it finds is reused for its reply.
- A smart clock. When the best move is clear it plays quickly, and the time saved goes to the hard moves.
- A proper ending. When both players pass, it estimates which stones are dead with another 32 imaginary games, shows the territory and counts the score.


How strong is it?

It plays at about 8 kyu. Choose 10, 20, 30 or 60 seconds per move, and change it at any time.
Handicaps of 2 to 5 stones: for you, or for the computer if you dare.


Features

- A menu to choose sides, time per move and handicap
- Optional Kempston joystick: a cursor on the board, Fire to play
- 9x9 Go against the computer, or two players on one Spectrum
- Monte Carlo tree search with RAVE, an opening library, thinking on your time
- Four time levels: 10, 20, 30, 60 seconds per move, changeable during the game
- Handicap 2-5 stones
- Area scoring, komi 7 (0.5 with handicap), positional superko
- Pass, undo, new game; the computer resigns hopeless games
- Automatic dead-stone marking, territory map and score count
- Hand-written Z80 assembly; everything fits in 48K and loads once
- Runs on the 48K, 128K, +2, +2A, +3 and Pentagon


Controls

In the menu: 1 who plays which colour, 2 time per move, 3 handicap, 4 Kempston joystick on or off, ENTER (or Fire) to start.

With the joystick on: move the cursor, Fire to play.
After two passes, Fire on a stone marks it dead, Fire on an empty point counts the score.

Move: column letter (A-H, J), row digit, ENTER. For example: E, 5, ENTER.

- P: pass
- U: undo (against the computer: its move and yours)
- N: new game, which is also resigning (Y to confirm, then the menu)
- K: handicap: 0, 2, 3, 4, 5 stones
- S: computer plays White / nobody (two players) / Black
- L: time per move: 10, 20, 30, 60 seconds
- CAPS SHIFT + 0: delete the input


Files

- go9x9.tap: tape image; on a real Spectrum it loads in just under three minutes
- go9x9.sna: snapshot for emulators, starts at once
- go9x9_en.txt: instructions

Free homebrew. © LAWLORD 2026.

Also by LAWLORD: TITANUS BATTLE (128K) (https://lawlord.itch.io/titanus-battle-128k),
                 War for the Ring (https://lawlord.itch.io/war-for-the-ring),
                 Office Slacker (https://lawlord.itch.io/office-slacker).
